package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.domain.Role;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);


    List<Employee> queryForList(QueryObject qo);

    void insertRelation(@Param("eId") Long eId, @Param("rId") Long rId);

    void deleteRelation(Long id);

    List<Role> selectRelation(Long id);

    Employee selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    Employee selecByUsername(String username);

    void updatePasswordByEmpId(Long id);

    void updatePassword(@Param("newPassword") String newPassword, @Param("id") Long id);

}